package com.ynny.mapper;

import com.ynny.entity.Emp;
import com.ynny.entity.EmpDTO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface EmpMapper {

    List<Emp> selectAll();
    List<Emp> selectAllByLikeEmpName(String empName);


    List<EmpDTO> selectAllAndDepartName();
    List<Map> selectAllAndDepartNameByMap();

    Emp selectOneById(Integer empId);

//    多参数传参  带上@Param注解
    Emp selectOneByNameAndSalary(@Param(value = "empName") String empName,
                                 @Param("salary") BigDecimal salary);

    Emp selectOneByNameAndSalary(Emp emp);

    Emp selectOneByNameAndSalary(Map map);


    int insert(Emp emp);

    int update(Emp emp);

    int deleteById(Integer id);

}
